<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="CajasCreateDlg" widgetVar="CajasCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.CreateCajasTitle}">

            <h:form id="CajasCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{cajasController.selected != null}">

                        <p:outputLabel value="#{myBundle.CreateCajasLabel_nroCaja}" for="nroCaja" />
                        <p:inputText id="nroCaja" value="#{cajasController.selected.nroCaja}" title="#{myBundle.CreateCajasTitle_nroCaja}" required="true" requiredMessage="#{myBundle.CreateCajasRequiredMessage_nroCaja}"/>

                        <p:outputLabel value="#{myBundle.CreateCajasLabel_descripcion}" for="descripcion" />
                        <p:inputText id="descripcion" value="#{cajasController.selected.descripcion}" title="#{myBundle.CreateCajasTitle_descripcion}" />

                        <p:outputLabel value="#{myBundle.CreateCajasLabel_saldoActual}" for="saldoActual" />
                        <p:inputText id="saldoActual" value="#{cajasController.selected.saldoActual}" title="#{myBundle.CreateCajasTitle_saldoActual}" />

                        <p:outputLabel value="#{myBundle.CreateCajasLabel_abierta}" for="abierta" />
                        <p:inputText id="abierta" value="#{cajasController.selected.abierta}" title="#{myBundle.CreateCajasTitle_abierta}" />

                        <p:outputLabel value="#{myBundle.CreateCajasLabel_cajeroActual}" for="cajeroActual" />
                        <p:selectOneMenu id="cajeroActual" value="#{cajasController.selected.cajeroActual}" >
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{usuariosController.items}"
                                           var="cajeroActualItem"
                                           itemValue="#{cajeroActualItem}"
                                           itemLabel="#{cajeroActualItem.descripcion.toString()}"
                                           />
                            <f:converter binding="#{usuariosConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{cajasController.saveNew}" value="#{myBundle.Save}" update="display,:CajasListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,CajasCreateDialog);"/>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="CajasCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
